package cn.whit.blog.service;

import java.sql.SQLException;
import java.util.List;

import cn.whit.blog.domain.EmailType;
import cn.whit.blog.domain.User;
import cn.whit.blog.util.DynamicQuery;
import cn.whit.blog.util.PageModel;

public interface UserService {
	List<User> findAllWithPageAndQuery(int startIndex, int pageSize, DynamicQuery query) throws Exception;

	int findTotalRecordsAndQuery(DynamicQuery query) throws Exception;

	PageModel findByPageAndQuery(int startIndex, int pageSize, DynamicQuery query) throws Exception;

	List<User> findByUserNameOrEmail(String userName, String email) throws SQLException;

	void save(User newUser) throws SQLException;

	List<User> findByUserNameAndPassword(String userName, String password) throws SQLException;
	
	List<User> findByActivecode(String activecode) throws SQLException;

	void update(User user) throws SQLException;

	List<User> findByEmail(String email) throws SQLException;

	void sendEmail(User user, EmailType backpassword,String newpass);

	void deleteById(String s) throws SQLException;
}
